
import request from '@/utils/request'

// 获取菜单列表
export function GetMenus(params) {
  return request({
    url: 'AccessManage/GetMenus',
    method: 'get',
    params
  })
}
// 获取菜单列表
export function GetMenusByEmployee(params) {
  return request({
    url: 'AccessManage/GetMenusByEmployee',
    method: 'get',
    params
  })
}
// 获取菜单列表
export function GetUser(params) {
  return request({
    url: 'User/GetUser',
    method: 'get',
    params
  })
}
// 判断登录或者注册，返回用户信息

export function LoginOrRegister(params) {
  return request({
    url: 'user/login_or_register',
    method: 'post',
    data: params
  })
}
// 分页获取角色列表
export function GetRolesPage(params) {
  return request({
    url: 'AccessManage/GetRolesPage',
    method: 'get',
    params
  })
}
// 根据ID获取角色详情
export function GetRole(params) {
  return request({
    url: 'AccessManage/GetRole',
    method: 'get',
    params
  })
}
// 获取所有的角色
export function GetRoles(params) {
  return request({
    url: 'AccessManage/GetRoles',
    method: 'get',
    params
  })
}
// 分页获取员工列表
export function GetEmployeePage(params) {
  return request({
    url: 'AccessManage/GetEmployeePage',
    method: 'get',
    params
  })
}
// 根据角色获取对应的权限树
export function GetMenusByRole(params) {
  return request({
    url: 'AccessManage/GetMenusByRole',
    method: 'get',
    params
  })
}
// 配置角色对应权限
export function ModifyMenusForRole(params) {
  return request({
    url: 'AccessManage/ModifyMenusForRole',
    method: 'post',
    data: params
  })
}
// 新建角色
export function AddRole(params) {
  return request({
    url: 'AccessManage/AddRole',
    method: 'post',
    data: params
  })
}
// 新建员工
export function AddEmployee(params) {
  return request({
    url: 'AccessManage/AddEmployee',
    method: 'post',
    data: params
  })
}
// 修改角色的基本信息（名称与关联员工）
export function UpdateRole(params) {
  return request({
    url: 'AccessManage/UpdateRole',
    method: 'put',
    data: params
  })
}
export function DeleteRole(params) {
  return request({
    url: 'AccessManage/DeleteRole',
    method: 'delete',
    params
  })
}
// 返回菜单关联的角色信息
export function GetRolesByMenu(params) {
  return request({
    url: 'AccessManage/GetRolesByMenu',
    method: 'get',
    params
  })
}
// 配置菜单的角色关联关系
export function ModifyRolesForMenu(params) {
  return request({
    url: 'AccessManage/ModifyRolesForMenu',
    method: 'post',
    data: params
  })
}
// 修改员工的基本信息（名称与关联角色）
export function UpdateEmployee(params) {
  return request({
    url: 'AccessManage/UpdateEmployee',
    method: 'put',
    data: params
  })
}
// 删除员工
export function DeleteEmployee(params) {
  return request({
    url: 'AccessManage/DeleteEmployee',
    method: 'delete',
    params
  })
}

// 获取员工树
export function GetEmployeeTree(params) {
  return request({
    url: 'AccessManage/GetEmployeeTree',
    method: 'get',
    params
  })
}
// 获取员工树
export function SetEmployeeParent(params) {
  return request({
    url: 'AccessManage/SetEmployeeParent',
    method: 'put',
    data: params
  })
}
